<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="datapackage.*" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Hashtable" %>
<%---updated on 30/9/2010 --%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Tab Horaire</title>
      <link rel="stylesheet" type="text/css" href="background.css" />
           <%--   <link rel="stylesheet" type="text/css" href="http://10.130.0.12/themes/cofares.css" />  --%>
        <jsp:useBean id="pcp" class="bean.PrepClean" scope="application" />
        <jsp:useBean id="param" class="datapackage.AnCeBean" scope="session" />

        <%--le conflit est recuperer dans une session bean     ----%>
        <jsp:useBean id="ipb" class="datapackage.IntituleProfBean" scope="session" />

    </head>
    <body>
        <%
        int noChef = param.getNoChef();
        int annee = param.getAnnee();
        int idcentre = param.getCentre();
        int spec = param.getSpec();
        int[] gradeaffL = param.getGradeaff();
        int langue=param.getLangue();
        int matspec=param.getMatspec();//pour choisissez les matspec ou non
        List<NoenseigChef> ncl = datapackage.DivertList.AvoirNoenseigChef();
        List<UeProf> upl = datapackage.DivertList.AvoirUeProfGdL(annee, idcentre, spec, gradeaffL,langue,matspec);
        IntituleProf ip = ipb.getIp();//avoir l'intitule prof
        boolean samedi=false;// boolean pour disable samedi
%>
    <form action="cleanServlet" method="post">
            <table  width="100%" style="padding: 0; border:0">
                <tr>
                    <td width="4%" class="title">Horaire</td>
                    <td width="16%" class="title">Lundi</td>
                    <td width="16%" class="title">Mardi</td>
                    <td width="16%" class="title">Mercredi</td>
                    <td width="16%" class="title">Jeudi</td>
                    <td width="16%"  class="title">Vendredi</td>
                    <td width="16%"  class="title">Samedi</td>
                </tr>
                <%
        for (int p = 0; p <= StaticClass.periode-1; p++) {
                %>
                <tr>
                    <td id="horaire">P<%=p+1%></td>

                    <%  for (int j = 1; j <= 6; j++) {
                        if(p==3 && j==6){samedi=true;}
    %>

    <td id="horaire" valign="top" align="center" <%if(samedi){%>bgcolor="gray"<%}%> >
        <%if(samedi){%><p>6h-->8h</p><%}%>
        <%
      //avoir l'horaire du prof de ce spec  gradeaff pour p,j
      List<UeProf> mpl = datapackage.DivertList.AvoirMP2(annee, idcentre, spec, gradeaffL, p, j,langue,matspec);
      for (UeProf up : mpl) {%>
      
      <% if ((ip != null) && (ip.getNoenseig()==up.getNoenseig())) {
              out.println("<font color=green><b>");
          }%>
      <%= up.getIntitule()%><br/>
      <i> <%= up.getPrenom() + " " + up.getNomprof() + " G" + up.getNoGroupe()%></i>
      <% if ((ip != null) && (ip.getNoenseig()==up.getNoenseig())) {
              out.println("</b></font>");
          }%>
      <br>
      <hr size="1" align="center" color="blue">
      <%}%>
      <%--- disabling saturday 30/9/2010 
     <%if (!samedi){%>
      <input  type="checkbox" name="cell" value="<%=p + "" + j%>" onclick="submit()">
      <%= pcp.afficheConflit(param,ip, p, j)%>
         <%}%>
       --%>
      <input  type="checkbox" name="cell" value="<%=p + "" + j%>" onclick="submit()">
      <%= pcp.afficheConflit(param,ip, p, j)%>
         
      </td>
      <%}%>

                </tr>
                <%}%>
            </table>
      
                    </form>
    
    </body>
</html>
